import java.io.*;
import java.util.*;
import java.lang.Character;

class Regexp {
	public static void main( String args[]){
		String text = "Filipe Augusto de Assis Moreira";

		if (args.length > 0){
			System.out.println ("Wrong number of arguments");
		} else {
			try{            
				BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
				System.out.print ("Enter the phrase: ");
				text = input.readLine();
		        } catch(Exception e){ e.printStackTrace();}
		}
		
		StringTokenizer st = new StringTokenizer(text, " " );

		boolean firstWord=true;

		while ( st.hasMoreTokens()){
			StringBuffer next = new StringBuffer(st.nextToken().toLowerCase());

			if(firstWord){
				firstWord=false;
			}
			else{
				char d=Character.toUpperCase(next.charAt(0));
				next.setCharAt(0,d);
			}

			//Pattern p = Pattern.compile ("^a-z");
			//Matcher m = pattern.matcher(text);
			System.out.print (next);
		}
		System.out.println("");
	}
}
